/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package icplproblem;

import java.util.ArrayList;

/**
 *
 * @author nikhil
 */
public class UserCodeMain {
    
    public static int[] output1;
    public static ArrayList<Integer> array;
    public static void GetOriginalScore(int matchPlayed, int[] playerScore) {
        array = new ArrayList<Integer>();
        for (int i : playerScore) {
            array.add(i);
        }
        int i = 1;
        int j = array.size() - 1;
        while (i != j) {
            if (((array.get(i - 1).intValue()) - 1 == (array.get(i).intValue()) && (array.get(i).intValue()) == (array.get(i + 1).intValue()) + 1) || ((array.get(i - 1).intValue()) + 1 == (array.get(i).intValue()) && (array.get(i).intValue()) == (array.get(i + 1).intValue()) - 1) ) {
                array.remove(i - 1);
                array.remove(i);
                i = 1;
                j = array.size() - 1;
                
            } else {
                
                i++;
            }
        }
        j = 0;
        output1 = new int[array.size()];
        for (Integer k : array) {
            output1[j] = k.intValue();
            j++;
        }
        
        
    }
}
